package models

import (
	"gorm.io/gorm"
)

type User struct {
	gorm.Model
	Username string `gorm:"type:varchar(30)" json:"username"`
	Password string `gorm:"type:varchar(50)" json:"password"`
}

type Live struct {
	gorm.Model
	Title      string `gorm:"type:varchar(200)" json:"title"`
	Author     string `gorm:"type:varchar(50)" json:"author"`
	Img        string `gorm:"type:varchar(255)" json:"img"`
	LikeCount  int    `gorm:"type:int" json:"like_count"`
	FocusCount int    `gorm:"type:int" json:"focus_count"`
	UserId     int    `gorm:"type:int" json:"user_id"`
	User       User   `gorm:"foreignKey:UserId" json:"user"`
}

type Focus struct {
	gorm.Model
	UserId int  `gorm:"type:int" json:"user_id"`
	User   User `gorm:"foreignKey:UserId" json:"user"`
	LiveId int  `gorm:"type:int" json:"live_id"`
	Live   Live `gorm:"foreignKey:LiveId" json:"live"`
}
